package com.learn1;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Main {
    public static void main(String[] args) {
        // 1. 声明Spring 容器，并加载配置类
        AnnotationConfigApplicationContext ac = new AnnotationConfigApplicationContext(DiConfig.class);
        // 2. 获取Bean 对象
        UseFunctionService useFunctionService = ac.getBean(UseFunctionService.class);
        // 3. 输出
        System.out.println(useFunctionService.sayHello("World"));
    }
}
